/*
 * @Author: your name
 * @Date: 2020-08-19 18:08:31
 * @LastEditTime: 2021-05-10 14:20:05
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \mobilephoneStyleb\src\router\index.js
 */
import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);
// 引入子组件
// import Login from '../views/Login.vue'
import User from "../views/user.vue";
import One from "../views/one.vue";
import Two from "../views/two.vue";

// 官网 : 在模块化工程中使用 VueRouter , 必须使用Vue.use()安装一下 (把路由当成vue的插件来使用)
Vue.use(VueRouter);

//2 实例化路由
const router = new VueRouter({
  routes: [
    // { path: '/', redirect: '/login' },
    // { path: '/login', name: 'login', component: Login },
    {
      path: "/user", name: "user", component: User,
      children: [
        {
          path: 'one',
          name: 'One',
          component: One
        },

        {
          path: 'two',
          name: 'Two',
          component: Two
        }
      ]
    },

  ],
});

export default router;
